{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#tab_basic">基本设置</a></li>
    <li><a href="#tab_share">首页分享</a></li>
</ul>
<div class="app-content">
	<div class="app-form">
        <form action="" method="post" class="form-horizontal" id="setting-form">
            <div class="panel panel-default">
                <div class="panel-heading">基本设置</div>
                <div class="panel-body">
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_basic">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">单人每日砍价次数</label>
                                <div class="col-sm-9">
                                    <div class="input-group">
                                        <input type="number" min="0" name="base[syslimit]" class="form-control" value="{$base['syslimit']}">
                                        <span class="input-group-addon">次/天</span>
                                    </div>
                                    <span class="help-block">单人每日可砍价次数，包括帮砍和自己发起的初次砍价,不填或填0则不限制次数。</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">首页社群</label>
                                <div class="col-sm-9">
                                    <select name="base[communityid]" class="form-control chosen-select">
                                        <option value="0" >不显示社群</option>
                                        {loop $communitylist $key $val}
                                        <option value="{$val['id']}" {if $val['id'] == $base['communityid']}selected{/if}>{$val['communname']}</option>
                                        {/loop}
                                    </select>
                                    <span class="help-block">请选择首页是否显示社群</span>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-2 control-label">选项卡分类是否显示图片</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="radio radio-success radio-inline">
                                        <input type="radio" id="img_switch1" name="base[img_switch]" value="0" {if $base['img_switch'] != 1}checked="checked"{/if}>
                                        <label for="img_switch1">关闭 </label>
                                    </div>
                                    <div class="radio radio-success radio-inline">
                                        <input type="radio" id="img_switch2" name="base[img_switch]" value="1" {if $base['img_switch'] == 1}checked="checked"{/if}>
                                        <label for="img_switch2">开启 </label>
                                    </div>
                                    <span class="help-block">开启后，所有砍价选项卡下面的分类都会显示图片</span>
                                </div>
                            </div>

                            <div class="form-group" >
                                <label class="col-sm-2 control-label">砍价玩法标题</label>
                                <div class="col-sm-9">
                                    <div class="input-group" style="width: 100%;">
                                        <input type="text" name="base[playtitle]" placeholder="砍价购" class="form-control" value="{$base['playtitle']}">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 control-label">砍价玩法描述</label>
                                <div class="col-sm-9">
                                    <div class="input-group" style="width: 100%;">
                                        <input type="text" name="base[playdesc]" placeholder="邀请好友砍价，超低价购买心仪商品！" class="form-control" value="{$base['playdesc']}">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group" >
                                <label class="col-sm-2 control-label">砍价玩法详情</label>
                                <div class="col-sm-9">
                                    <div class="input-group" style="width: 100%;" >
                                        <textarea name="base[playdetail]" style="min-height: 300px;" class="form-control">{$base['playdetail']}</textarea>
                                        <span class="help-block">未填入会显示系统默认解释详情</span>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <div class="tab-pane" id="tab_share">
                            <div class="alert alert-info">
                                <b>适用模板变量：[昵称] [时间] [系统名称]</b>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">分享标题</label>
                                <div class="col-sm-9">
                                    <input type="text" name="base[share_title]" class="form-control" value="{$base['share_title']}" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">分享图片</label>
                                <div class="col-sm-9">
                                    {php echo attachment_select('base[share_image]', $base['share_image']);}
                                    <span class="help-block">推荐图片尺寸500X500</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">分享描述</label>
                                <div class="col-sm-9">
                                    <input type="text" name="base[share_desc]" class="form-control" value="{$base['share_desc']}" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <div class="col-sm-9">
                    <input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
                    <input type="hidden" name="token" value="{$_W['token']}" />
                </div>
            </div>
        </form>
	</div>
</div>
<script>
	$(function() {
		window.optionchanged = false;
		$('#myTab a').click(function(e) {
			e.preventDefault(); //阻止a链接的跳转行为
			$(this).tab('show'); //显示当前选中的链接及关联的content
		})
	});
</script>
{php include wl_template('common/footer');}